import Vue from "vue";
import Vuex from "vuex";
import createPersistedState from "vuex-persistedstate";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    // 保存用户的token
    token: "",
  },
  getters: {},
  mutations: {
    updateToken(state, val) {
      state.token = val;
    },
  },
  actions: {},
  modules: {},
  plugins: [createPersistedState()],
});
